<%-- 
    Document   : role
    Created on : 2016-7-1, 14:13:07
    Author     : 52461
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@include file="../link.jsp"%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <script type="text/javascript" src="${base}/js/LodopFuncs.js" ></script>
        <title>JSP Page</title>
        <style id="style1">
            * { margin:0; padding:0;font-size:16px;}
            body { margin:0; padding:0;  font-family:"微软雅黑";}
            table td { padding:3px 1px;}
            .title { font-size:24px; text-align:center; width:40%;}
            .check_info th { border-bottom:1px #666 solid; padding-bottom:5px;}
            /*.check_info td,th{ padding-left:20px;}*/
            .hx{ border-right:  1px #666 solid}
        </style>
    </head>
    <body  ng-app="jyjgManager" ng-controller="jyjgCtrl">
        <table width="1000px" style=" margin:0 auto;" cellpadding="0" cellspacing="0" id="print">
            <tr>
                <td colspan="2">
                    <div style="text-align: center">
                        <h3><%=DataCache.getIntance().getConfig().get("hospitalName")%>检验报告单</h3>
                    </div>
                </td>
            </tr>
            <tr>
                <td colspan="2"> 
                    <table cellpadding="0" cellspacing="0" width="100%" style=" border-bottom:1px #666 solid;">
                        <tr>
                            <td align="right" width="80px">姓名：</td>
                            <td contenteditable="true" align="left" width="100px">{{info.PATIENTNAME}}</td>
                            <td align="right">病历号：</td>
                            <td contenteditable="true" align="left" width="100px">{{info.PATIENTID}}</td>
                            <td align="right">科室：</td>
                            <td contenteditable="true" align="left" width="100px">{{info.SECTION}}</td>
                            <td align="right">样本号：</td>
                            <td contenteditable="true" align="left" width="120px">{{results[0].SAMPLENO}}</td>
                        </tr>
                        <tr>
                            <td align="right">性别：</td>
                            <td contenteditable="true" align="left">{{info.SEX}}</td>
                            <td align="right">病房号：</td>
                            <td contenteditable="true" align="left"></td>
                            <td align="right">检验医生：</td>
                            <td contenteditable="true" align="left">{{info.JYYS}}</td>
                            <td align="right">标本类型：</td>
                            <td contenteditable="true" align="left">{{info.SAMPLE}}</td>
                        </tr>
                        <tr>
                            <td align="right">年龄：</td>
                            <td contenteditable="true" align="left">{{info.AGE}}</td>
                            <td align="right">床号：</td>
                            <td contenteditable="true" align="left">{{info.BED_NO}}</td>
                            <td align="right">机器型号：</td>
                            <td contenteditable="true" align="left">{{results[0].DEVICEID}}</td>
                            <td align="right">检验项目：</td>
                            <td contenteditable="true" align="left">{{info.EXAMINAIM}}</td>
                        </tr>
                    </table>
                </td>
            </tr>
            <tr style="border-bottom:1px #666 solid;height:400px;width: 100%;">
                <td valign="top"  style=" padding-left:0;width: 50%">
                    <table cellpadding="0" cellspacing="0" width="100%" class="check_info">
                        <thead>
                            <tr>
                                <th align="left">项目简称</th>
                                <th align="left">项目名称</th>
                                <th></th>
                                <th align="left">结果</th>
                                <th align="left">单位</th>
                                <th align="left">参考范围</th>
                            </tr>
                        </thead>
                        <tbody>
                            <tr ng-repeat="le in left">
                                <!--<td>{{$index+1}}</td>-->
                                <td>{{le.TESTID}}</td>
                                <td>{{le.CHINESENAME}}</td>
                                <td>{{le.HL_STATUS}}</td>
                                <td>{{le.TESTRESULT}}</td>
                                <td>{{le.UNIT}}</td>
                                <td ng-class="{true: 'hx', false: 'inactive'}[isActive]">{{le.fanwei}}</td>
                            </tr>
                        </tbody>
                    </table>
                </td>
                <td valign="top" style="padding-left:10px; margin:0;display:none;width: 50%" id="fenye">
                    <table cellpadding="0" cellspacing="0" width="100%" class="check_info" style="">
                        <thead>
                            <tr>
                                <th align="left">项目简称</th>
                                <th align="left">项目名称</th>
                                <th></th>
                                <th align="left">结果</th>
                                <th align="left">单位</th>
                                <th align="left">参考范围</th>
                            </tr>
                        </thead>
                        <tbody>
                            <tr ng-repeat="ri in right">
                                <!--<td>{{$index+15}}</td>-->
                                <td>{{ri.TESTID}}</td>
                                <td>{{ri.CHINESENAME}}</td>
                                <td>{{ri.HL_STATUS}}</td>
                                <td>{{ri.TESTRESULT}}</td>
                                <td>{{ri.UNIT}}</td>
                                <td>{{ri.fanwei}}</td>
                            </tr>
                        </tbody>
                    </table>
                </td>
            </tr>
            <tr>
                <td colspan="2">
                    <table>
                        <tr >
                            <td  align="right" width="100px">备注： </td>
                            <td  colspan="5" contenteditable="true" align="left" width="600px">此结果仅对本份检验标本负责</td>
                            <td  colspan="" align="right">审核人：</td>
                            <td  colspan="2" contenteditable="true" align="left" width="200px">{{info.CHECKOPERATOR}}</td>
                        </tr>
                        <tr>
                            <td  align="right" width="100px">检验时间：</td>
                            <td  colspan="5" contenteditable="true" align="left" width="600px">{{results[0].MEASURETIME}}</td>
                            <td align="right">打印日期：</td>
                            <td colspan="2" contenteditable="true" align="left" width="200px">{{date}}</td>
                        </tr>
                    </table>
                </td>

            </tr>

        </table>
        <!--        
                        <div class="col-lg-12">
                            <div class="col-lg-4">打印日期：2013-09-11</div>
                             <div class="col-lg-4"></div>
                              <div class="col-lg-4">审核人：管理员</div>
                        </div>
                        <div class="col-lg-12">
                            <div class="col-lg-4">此结果仅对本份检验标本负责</div>
                             <div class="col-lg-4">备注</div>
                              <div class="col-lg-4">机器型号：00013</div>
                        </div>-->
    </body>
</html>
<script>
    angular.module("jyjgManager", [])
            .controller("jyjgCtrl", function ($scope) {
                if (localStorage.results) {
                    $scope.results = JSON.parse(localStorage.results);
                }
                if (localStorage.info) {
                    $scope.info = JSON.parse(localStorage.info);
                }
//                $scope.sampleNo = localStorage.sampleNo;
                $scope.date = localStorage.date;
                $scope.left = [];
                $scope.right = [];
                $scope.isActive = false;
                console.table($scope.results);
                if ($scope.results.length > 14) {
                    for (var i = 0; i < 14; i++) {
                        var l = $scope.results[i];
                        $scope.left.push(l);
                    }
                    for (var j = 14; j < $scope.results.length; j++) {
                        var r = $scope.results[j];
                        $scope.right.push(r);
                    }
                    $("#fenye").show();
                    $("#hh").addClass("hx");
                    $scope.isActive = true;
                } else {
                    for (var i = 0; i < $scope.results.length; i++) {
                        var l = $scope.results[i];
                        $scope.left.push(l);
                    }
                }
                var LODOP;
                function CreateOneFormPage(){
                    LODOP=getLodop();  
                    LODOP.PRINT_INIT("打印控件功能演示_Lodop功能_全页");
                    LODOP.ADD_PRINT_HTM(0,30,10,800,document.documentElement.innerHTML);
                    LODOP.SET_PREVIEW_WINDOW(0,0,0,0,0,"");	
                    LODOP.SET_PRINT_MODE("PRINT_PAGE_PERCENT","Width:75%;Height:75%");
                    LODOP.SET_PREVIEW_WINDOW(1,0,0,0,0,"");
                    LODOP.PREVIEW();
                };	 
                setTimeout(function () {
                    CreateOneFormPage();
                }, 2000)


            })

</script>
